<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    宽度：<input id="width" type="text">
    <br>
    高度：<input id="height" type="text">
    <br>
    <input id="calculate" type="button" value="计算">
    <br>
    周长：<input id="perimeter" type="text">
    <br>
    面积：<input id="area" type="text">
</body>
<script>
    var width = document.getElementById("width")
    var height = document.getElementById("height")
    var cal = document.getElementById("calculate")
    var per = document.getElementById("perimeter")
    var area = document.getElementById("area")
    cal.onclick = function(){

    }
</script>
</html>